#include "yw_management.h"

int main(int argc, const char *argv[])
{

	pthread_mutex_init(mutex_sql, NULL);
	pthread_mutex_init(mutex_zig, NULL);
	pthread_mutex_init(mutex_msg, NULL);

	pthread_t m0_thread;
	if(pthread_create(&m0_thread, NULL, yw_thread_m0, NULL) != 0)
	{
		perror("pthread create failed!");
		exit(1);
	}

	pthread_t html_thread;
	if(pthread_create(&html_thread, NULL, yw_thread_html, NULL) != 0)
	{
		perror("pthread create failed!");
		exit(1);
	}

	pthread_join(m0_thread, NULL);
	pthread_join(html_thread, NULL);

	phread_mutex_destroy(&mutex_sql);
	phread_mutex_destroy(&mutex_zig);
	phread_mutex_destroy(&mutex_msg);
	
	return 0;
}
